﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperSocket.SocketBase.Command;
using SuperWebSocket.SubProtocol;

namespace _21SocketServer.Command
{
    public static class RESTART
    {
        public static void Execute(I21Session session, CommandInfo<string> commandInfo)
        {
            var game = session.Server.Game;
            lock (game)
            {
                game.Restart();
            }
        }
    }

    public class RESTART_S : StringCommandBase<_21Session>
    {
        public override string Name
        {
            get
            {
                return "RESTART";
            }
        }

        public override void ExecuteCommand(_21Session session, StringCommandInfo commandInfo)
        {
            RESTART.Execute(session, commandInfo);
        }
    }

    public class RESTART_WS : SubCommandBase<_21WebSession>
    {
        public override string Name
        {
            get
            {
                return "RESTART";
            }
        }

        public override void ExecuteCommand(_21WebSession session, SubRequestInfo requestInfo)
        {
            RESTART.Execute(session, requestInfo);
        }

    }
}
